<!DOCTYPE html>
<html>
    
    <head>
       <meta charset="UTF-8">
        {include="style"}
		{include="edit"}
		
    </head>
    
    <body>
	 <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>扩展模块管理</cite></a>
              <a><cite>修改{$molds['name']}</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="iconfont" style="line-height:30px">&#xe6aa;</i></a>
        </div>
        <div class="x-body">
            <form class="layui-form layui-form-pane" >
			<input type="hidden" name="go" value="1" />
			<input type="hidden" name="id" value="{$data['id']}" />
			
			<div class="layui-tab">
			  <ul class="layui-tab-title">
				<li class="layui-this">基本信息</li>
				
			  </ul>
			  <div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
			
				<div class="layui-form-item">
                    <label for="tid" class="layui-form-label">
                        <span class="x-red">*</span>所属分类
                    </label>
                    <div class="layui-input-inline">
						<select name="tid" lay-search="" lay-verify="required" lay-filter="tid" id="tid" >
						
						<option value="">选择分类</option>
						
					  {loop table="link_type" as="v"}
					   <option {if($data['tid']==$v['id'])}selected{/if} value="{$v['id']}">{$v['name']}</option>
					
					   {/loop}
					   
					   </select>
                    </div>
					
                </div>
				
				<span id="ext_fields"></span>
				
				
				
				<div class="layui-form-item" pane>
                    <label for="isshow" class="layui-form-label">
                        <span class="x-red"></span>是否显示
                    </label>
                    <div class="layui-input-block">
                        <input type="radio" name="isshow" value="0" title="不显示" {if($data['isshow']==0)}checked{/if}>
						<input type="radio" name="isshow" value="1" title="显示" {if($data['isshow']==1)}checked{/if}>
					
                    </div>
					 
					
                </div>
			
				</div>
				
				
			  </div>
			</div>
						
               
                
                <div class="layui-form-item" id="jizhitj"  style="text-align:center;">
                    
                     <button  class="layui-btn" lay-filter="save" lay-submit="">
                        保存
                    </button>
                </div>
            </form>
        </div>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
      
        <script>
		{include="fields"}
            layui.use(['laydate','form','layer','upload'], function(){
                $ = layui.jquery;
              var form = layui.form
              ,layer = layui.layer;
			  laydate = layui.laydate;
			  
			  var upload = layui.upload;
			 
			     //监听提交
              form.on('submit(save)', function(data){
                
				$.post("{fun U('Links/editlinks',array('molds'=>$molds['biaoshi']))}",data.field,function(r){
					var r = JSON.parse(r);
					if(r.code==0){
					
						layer.confirm(r.msg, {
						  btn: ['返回列表','取消'] //按钮
						}, function(){
							// 获得frame索引
							{if($webconf['admintpl']=='tpl')}
							window.location.href="{fun U('Links/index',['molds'=>$molds['biaoshi']])}";
							{else}
							parent.location.reload();
							{/if}
						  
						}, function(){
						  
						});
					
						
					}else{
						layer.alert(r.msg, {icon: 5});
					}
				});
				
               
                return false;
              });
            get_fields(0,{$data['id']});
			
			  
			
		
			
           
              
              
            });
        </script>
      
    </body>

</html>